package com.java.array;

public class ArrayDemo2 {

    public static void main(String[] args){
        //定义数组
        String[] names = {"曹操","刘备","张飞","赵云","关羽"};
        //常规的for
//        for(int i = 0;i < names.length;i++){
//            System.out.println("人的名字：" + names[i]);
//        }
        //foreach循环
        for(String name : names){
            System.out.println("姓名：" + name);
        }
    }
}
